1. Field of the Invention
The present invention relates to a coding/decoding apparatus and method, or more particularly to an apparatus and method for coding a signal such as digital-encoded information of voice and image signals into code information and decoding vice versa.
In general, code information, which is generated for each quantization point in vector quantization method, for example, is transmitted over a transmission line (hereinafter the term line may imply transmission facilities including a communication control unit, modem and transmission line) having a predetermined transmission rate, along with frame synchronizing signals and overhead information. Therefore, the practical transmission rate available for transmission of the rode information per se is usually lower than the actual transmission rate.
Also, the rode information may be stored in a predetermined length of a storage area of an external memory (e.g., magnetic disk), along with other information (e.g., a error cheek and correction bit). Therefore, the practical length of a storage area available for storing the rode information is usually smaller than the actual length of the storage area.
For the above reason, the average number of code-information bits required for expressing the whole quantization points may not be an integer.
Let's assume that the average number of code-information bits required for expressing the whole quantization points is 8.5 bits, for example. If 9 bits of code information is generated each time, it is impossible to transmit or record the code information without loss of the information. Also, if 8 bits of code information is generated each time, the number of code-information bits given cannot be utilized fully and the system resources (i.e., transmission line and external memory) cannot be used effectively and efficiently.
Therefore, a coding/decoding apparatus and method, which can achieve the optimum coding/decoding and utilize such system resources effectively and efficiently, is in great demand.
2. Description of the Related Art
FIG. 1 is a block diagram illustrating a coding/decoding method of the related art.
A coding device 40, which codes a speech signal into code information using a vector quantization method, is comprised of a coder 7 and a transmitter (abbreviated to XMTR) 5. The coder 7 is comprised of a code book (abbreviated to CB) 7.sub.1, a multiplier 7.sub.2, an adaptive predictor (abbreviated to AP) 7.sub.3 of gain g, a speech-synthesis filter (abbreviated to F) 7.sub.4, an adaptive predictor (AP) 7.sub.5 of synthetic filter coefficients a.sub.1 -a.sub.p, a subtracter 7.sub.6 and a coding controller 7.sub.7.
A decoding device 50, which decodes the code information into the speech signal using a vector quantization method, is comprised of a receiver (abbreviated to RCVR) 6 and a decoder 8. The decoder 8 is comprised of a code book (CB) 8.sub.1 which has the same construction as the above code book 7.sub.1, a multiplier 8.sub.2, an adaptive predictor (AP) 8.sub.3 of gain g, a speech-synthesis filter (F) 8.sub.4, and an adaptive predictor (AP) 8.sub.5 of synthetic filter coefficients a.sub.1 -a.sub.p.
In the coder 7, the coding controller 7.sub.7 extracts a particular speech drive signal series c.sub.n (hereinafter called a code vector) from the code book 7.sub.1 and generates a reproduction speech signal series x.sub.n. Then, the coding controller 7.sub.7 calculates an error electric power E relative to an input speech signal series y.sub.n, evaluates the error electric power E and searches the code book 7.sub.1 for a code vector c.sub.n which causes the reproduction speech signal series x.sub.n to minimize the error electric power E. The coding controller 7.sub.7 then reads an index A corresponding to the code vector from code book 7.sub.1 and transmits the index A to the decoding device 50 as code information. (Although the code information includes other data such as the filter coefficient, an example of transmitting only the index A as code information is explained here for easy understanding.)
Based on the received code information A, the decoder 8 reproduces the same reproduction speech signal series x.sub.n as that which was evaluated by the coder 7 as minimizing the error electric power E.
FIG. 2 is a timing chart illustrating a coding/decoding method of the related art. An example of coding/decoding of speech signal by using the vector quantization method is shown here.
The coder 7 generates the code information A for every 5 samples of the speech signal y.sub.n and transmits the code information A over the line 30 at a practical transmission rate of 13.6 k (k=1000) bps. (Even if the actual transmission speed is 16 k bps, the practical transmission speed available for transmission of the code information A may be 13.6 k bps, because, as mentioned above, frame synchronous signals and overhead information are inserted therein.)
When the speech signal is sampled every 125 micro-seconds (i. e., at a sampling frequency of 8k Hz), the period required for 5 samplings is 625 micro-seconds. Thus, 8.5 bits of code information A can be transmitted in the period of 625 micro seconds. Actually, only integral bits of information can be transmitted over the transmission line 30, though.
Therefore, a conventional method transmitted 8 bits of code information A.sub.1 and 9 bits of code information A.sub.2 alternately in first and second phases, respectively, as shown in FIG. 2. To transmit 9 bits of code information A.sub.2, coder 7 (See FIG. 1) required additional code book 7.sub.1 having 512 (=2.sup.9) code vector, for example. Accordingly, the coding controller 7.sub.7 generated 8-bit code information A.sub.1 by scanning the first half (2.sup.8 =256) of the code book 7.sub.1 in the first phase and 9-bit code information A.sub.2 by scanning the whole code book 7.sub.1 in the second phase. Or, the coder 7 had two separate code books (not shown in the figure) having 256 code vectors and 512 code vectors optimized for generating 8-bit code information A.sub.1 and 9-bit code information A.sub.2, respectively. Then, the coding controller 7.sub.7 selectively scanned the two code books according to the phase.
However, a problem is that the above methods using a plurality of code books require a large amount of memory capacity for the code books and a large amount of circuitry associated therewith, for switching the code books, for example.
Another problem is that the above code book 7.sub.1, whose first half and the whole are scanned alternately for obtaining the code information, cannot be optimized for both 8-bit code information A.sub.1 and 9-bit code information A.sub.2. That is, the code book 7.sub.1 optimized for generating 9-bit code information A.sub.2 cannot be optimized for the 8-bit code information A.sub.1. The same is true with the code book 7.sub.1 optimized for 8-bit code information A.sub.1, i.e. it cannot be optimized for the 9-bit code information A.sub.2.
Still another problem is that there is a problem with accuracy in the operation of the above gain g, speech-synthesis filter coefficient a.sub.1 -a.sub.p, and error electric power E. That is, to execute the operation with most accuracy in fixed-point arithmetic, for example, it is desirable to use the full bits (e.g., 16 bits) of a machine word of a processor (e.g., Digital Signal Processor).
If operand data is normalized on an 8-bit basis to generate 8-bit code information A.sub.1 so that an operation may not cause an overflow (in which a carry occurs from the most significant bit position into the sign bit position exceeding the decimal point), an operation for generating 9-bit code information A.sub.2 may cause an overflow. The same is true with the reverse ease in which normalization is conducted on an 9-bit basis. Thus, in order to simplify and speed up the operations, it is required to perform the operations either on an 8-bit or 9-bit basis, eventually decreasing the accuracy of operation.